<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            position: relative;
            width: 230px;
            height: 180px;
            margin: 100px;
            background-color: pink;
        }

        .triangle {
            position: absolute;
            right: 20px;
            top: -20px;
            width: 0;
            height: 0;
            border: 10px solid transparent;
            border-bottom-color: red;
        }
    </style>
</head>

<body>

    <div class="box">
        <div class="triangle"></div>
    </div>

</body>

</html>